package com.xisoft.main;


import com.xisoft.common.ProcessorException;
import com.xisoft.base.BaseModel;
import com.xisoft.handle.CheckHandler;
import com.xisoft.handle.DBHandler;
import com.xisoft.handle.HandlerChain;
import com.xisoft.handle.HandlerChainImp;
import com.xisoft.handle.TempldateHandler;

/**
 * @author xzh
 * @Date 2021/8/16 17:44
 * @description 代码生成运行启动类
 * 注意：本内容仅限于上海熙软科技有限公司内部，传阅，禁止外泄以及用于其他商业目的
 */
public class Application {

    public static void main(String[] args) throws ProcessorException {
        String tableNames = "BX_REFUND_ACCOUNT_DETAIL,BX_REFUND_ACCOUNT";
        batch(tableNames.split(","));
    }

    public static void batch(String[] tables) throws ProcessorException {
        for (String table : tables) {

            BaseModel model = new BaseModel();
            model.tablename = table;
            /** 项目基础包 **/
            model.basePackageName = "com.xisoft.bx.Test";
            model.author = "xzh";

            HandlerChain handlerChain = new HandlerChainImp();
            handlerChain.addHandler(new CheckHandler());
            handlerChain.addHandler(new DBHandler());
            handlerChain.addHandler(new TempldateHandler());
            handlerChain.handle(model);
        }
    }


}
